import { createRouter, createWebHashHistory } from 'vue-router'

const router = createRouter({
  history: createWebHashHistory(),
  routes: [
    {
      path: '/',
      name: 'Home',
      redirect: '/dashboard/operational/data',
      component: () => import('@/pages/Home.vue'),
      children: [
        {
          path: 'products',
          name: 'product-management',
          component: () => import('@/pages/ProductManagement/ProductManagement.vue'),
          redirect: '/products/show/list',
          children: [
            {
              path: 'show/list',
              name: 'ProductShowList',
              component: () => import('@/pages/Product/Product.vue'),
            },
            {
              path: 'list',
              name: 'list',
              component: () => import('@/pages/ProductList/ProductList.vue'),
            },
            {
              path: 'list/create',
              name: 'addProduct',
              component: () => import('@/pages/AddProduct/AddProduct.vue'),
            },
            {
              path: 'list/edit/:id',
              name: 'editProduct',
              component: () => import('@/pages/EditProduct/EditProduct.vue'),
            },
            {
              path: 'category',
              name: 'category',
              component: () => import('@/pages/Category/Category.vue'),
            },
            {
              path: 'review',
              name: 'review',
              component: () => import('@/pages/ProductReview/ProductReview.vue'),
            },
            {
              path: 'stock/shortage/application',
              name: 'StockShortageApplication',
              component: () => import('@/pages/StockShortageApplication/StockShortageApplication.vue'),
            },
          ],
        },
        {
          path: 'dashboard',
          name: 'dashboard',
          component: () => import('@/pages/Dashboard/Dashboard.vue'),
          redirect: '/dashboard/operational/data',
          children: [
            {
              path: 'operational/data',
              name: 'operationalData',
              component: () => import('@/pages/OperationalData/OperationalData.vue'),
            },
            {
              path: 'service/monitoring',
              name: 'serviceMonitoring',
              component: () => import('@/pages/ServiceMonitoring/ServiceMonitoring.vue'),
            },
            {
              path: 'cache/monitoring',
              name: 'cacheMonitoring',
              component: () => import('@/pages/CacheMonitoring/CacheMonitoring.vue'),
            },
          ],
        },
        {
          path: 'orders',
          name: 'order-management',
          component: () => import('@/pages/OrderManagement/OrderManagement.vue'),
          redirect: '/orders/statistics',
          children: [
            {
              path: 'statistics',
              name: 'order-statistics',
              component: () => import('@/pages/OrderStatistics/OrderStatistics.vue'),
            },
            {
              path: 'process',
              name: 'order-process',
              component: () => import('@/pages/OrderProcessing/OrderProcessing.vue'),
            },
            {
              path: 'after-sales',
              name: 'order-after-sales',
              component: () => import('@/pages/OrderAfterSales/OrderAfterSales.vue'),
            },
            {
              path: 'configuration',
              name: 'order-configuration',
              component: () => import('@/pages/OrderConfiguration/OrderConfiguration.vue'),
            },
            {
              path: 'reason/for/return',
              name: 'order-return-reason',
              component: () => import('@/pages/ReasonForReturn/ReasonForReturn.vue'),
            },
          ],
        },
        {
          path: 'statistics',
          name: 'statistics',
          component: () => import('@/pages/Statistics/Statistics.vue'),
        },
        {
          path: 'setting',
          name: 'setting',
          component: () => import('@/pages/Setting/Setting.vue'),
        },
        {
          path: 'marketing/campaign',
          name: 'MarketingCampaign',
          component: () => import('@/pages/MarketingCampaign/MarketingCampaign.vue'),
          redirect: '/marketing/campaign/coupon/list',
          children: [
            {
              path: 'coupon/list',
              name: 'couponList',
              component: () => import('@/pages/Coupon/CouponList/CouponList.vue'),
            },
            {
              path: 'collection/records',
              name: 'UserCouponCollectionRecords',
              component: () => import('@/pages/Coupon/UserCouponCollectionRecords/UserCouponCollectionRecords.vue'),
            },
            {
              path: 'point/configuration',
              name: 'PointConfiguration',
              component: () => import('@/pages/Points/PointsConfiguration/PointConfiguration.vue'),
            },
            {
              path: 'point/merchandise',
              name: 'PointMerchandise',
              component: () => import('@/pages/Points/PointsMerchandise/PointsMerchandise.vue'),
            },
            {
              path: 'point/orders',
              name: 'PointOrders',
              component: () => import('@/pages/Points/PointsOrder/PointsOrder.vue'),
            },
            {
              path: 'point/records',
              name: 'PointRecords',
              component: () => import('@/pages/Points/PointsRecords/PointsRecords.vue'),
            },
            {
              path: 'point/statistics',
              name: 'PointStatistics',
              component: () => import('@/pages/Points/PointsStatistics/PointsStatistics.vue'),
            },
            {
              path: 'flash/sale',
              name: 'flashSale',
              component: () => import('@/pages/FlashSale/FlashSale.vue'),
            },
            {
              path: 'short/dated/sale',
              name: 'shortDatedSale',
              component: () => import('@/pages/ShortDatedSale/ShortDatedSale.vue'),
            },
            {
              path: 'newcomer/area',
              name: 'NewcomerArea',
              component: () => import('@/pages/NewcomerArea/NewcomerArea.vue'),
            },
          ],
        },
        {
          path: 'content',
          name: 'ContentManagement',
          component: () => import('@/pages/ContentManagement/ContentManagement.vue'),
          redirect: '/content/carousel',
          children: [
            {
              path: 'carousel',
              name: 'Carousel',
              component: () => import('@/pages/Carousel/Carousel.vue'),
            },
            {
              path: 'zone',
              name: 'ZoneManagement',
              component: () => import('@/pages/ZoneManagement/ZoneManagement.vue'),
            },
            {
              path: 'brand',
              name: 'Brand',
              component: () => import('@/pages/BrandPage/BrandPage.vue'),
            },
            {
              path: 'ranking',
              name: 'hot-sales-ranking',
              component: () => import('@/pages/HotSalesRanking/HotSalesRanking.vue'),
            },
          ],
        },
        {
          path: 'customer',
          name: 'customer',
          component: () => import('@/pages/CustomerManagement/CustomerManagement.vue'),
          redirect: '/customer/statistics',
          children: [
            {
              path: 'statistics',
              name: 'CustomerStatistics',
              component: () => import('@/pages/CustomerStatistics/CustomerStatistics.vue'),
            },
            {
              path: 'management',
              name: 'CustomerManagement',
              component: () => import('@/pages/CustomerPage/CustomerPage.vue'),
            },
            {
              path: 'feedback',
              name: 'Feedback',
              component: () => import('@/pages/Feedback/Feedback.vue'),
            },
          ],
        },
      ],
    },
    {
      path: '/login',
      name: 'Login',
      component: () => import('@/pages/Login/Login.vue'),
    },
    {
      path: '/test',
      name: 'TestPage',
      component: () => import('@/pages/TestPage/TestPage.vue'),
    },
  ],
})

export default router
